package com.itstyle.cloud.common.interceptor;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter {

	@Value("${login_url}")
	private String loginUrl;

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new SysInterceptor(loginUrl))
		                         .addPathPatterns("/elfinder/connector/**","/disk.shtml");
		super.addInterceptors(registry);
	}
}